<template>
  <div>
    <div class="name">{{ sonName }}</div>
    <div class="son_name">{{ sonAge }}</div>
    <button @click="test1">我是EvenBus的Son组件</button>
  </div>
</template>

<script lang="js">
import EvenBus from '../utils/EvenBus'

export default {
  name: 'Son',
  data () {
    return {
      sonName: '杨青青'
    }
  },
  computed: {
    getSonName () {
      return '我是计算属性处理后的：' + this.sonName
    }
  },
  props: ['sonAge'],
  methods: {
    test1 () {
      EvenBus.$emit('xxx', '我是傻逼')
      console.log(this.$store.state.nameY)
      console.log(this.sonName)

      console.log(this.$store.getters.getNameY)
      console.log(this.getSonName)
    }
  },
  mounted () {
  }
}
</script>

<style lang="scss" scoped>

</style>
